package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.qdlc.p2p.common.constant.Global;

/**
 * 积分获得记录实体类
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "score_log")
public class ScoreLog {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 用户ID */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private User user;

    /** 变动积分数值 */
    private int score;

    /** 剩余可用积分 */
    private int validScore;

    /** 剩余冻结积分 */
    private int freezeScore;

    /** 积分行为，1：获取，2：消耗 */
    private int behavior;

    /** 积分类型名称 */
    private String scoreTypeName;

    /** 日志类型 */
    private String type;

    /** 备注 */
    private String remark;

    /** 添加时间 */
    private Date addTime;

    /** 添加IP */
    private String addIp;

    public ScoreLog() {
        super();
    }

    public ScoreLog(Score item) {
        super();
        this.setValidScore(item.getValidScore());
        this.setFreezeScore(item.getFreezeScore());
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int getValidScore() {
        return validScore;
    }

    public void setValidScore(int validScore) {
        this.validScore = validScore;
    }

    public int getFreezeScore() {
        return freezeScore;
    }

    public void setFreezeScore(int freezeScore) {
        this.freezeScore = freezeScore;
    }

    public String getScoreTypeName() {
        return scoreTypeName;
    }

    public void setScoreTypeName(String scoreTypeName) {
        this.scoreTypeName = scoreTypeName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public String getAddIp() {
        return addIp;
    }

    public void setAddIp(String addIp) {
        this.addIp = addIp;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getBehavior() {
        return behavior;
    }

    public void setBehavior(int behavior) {
        this.behavior = behavior;
    }

}
